<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<h2>出用户的数据类型使用关键字 typeof</h2>
		<script type="text/javascript">
			//怎么判断出用户的数据类型使用关键字 typeof
			
			var a = 10;//number
			document.write(typeof a);
			
			var b = "3";//string
			document.write(typeof b);
			
			document.write("<br>");
			//隐式转换
			var c = a - b;
			// document.write(c);
			document.write(typeof c);//number
			
			//+号是拼接
			var d = a + b;
			document.write("<br>");
			document.write(d);
			document.write(typeof d);//string
			//显示转换 (强制转换)
			document.write("<br>");
			document.write(typeof Number(b));
			
			
			var e = a + Number(b);
			document.write("<br>");
			document.write(e);
			document.write(typeof e);//number
			
			//显示转换 (强制转换)
			var f = String(100);
			document.write(typeof f);
			
			
			
		</script>
	</body>
</html>
